PATH  Mac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Icon Services and Utilities
>
Obtaining and Using Icons With Icon Services

   

GetIconRef

Provides an IconRef for an icon in the desktop database or for a registered icon.

pascal OSErr GetIconRef(
                     SInt16 vRefNum,
                     OSType creator,
                     OSType iconType,
                     IconRef*iconRef);

vRefNum
A value of type SInt16 specifying the volume where Icon Services should start to search for the desired icon. Pass the kOnSystemDisk constant if you are not sure which value to specify in this parameter.

creator
A value of type OSType specifying the creator code of the desired icon.

iconType
A value of type OSType specifying the type code of the desired icon.

iconRef
A pointer to a value of type IconRef . On return, this value contains a reference to the desired icon data.

function result
A result code. See Icon Services Result Codes for a description of possible return values.
DISCUSSION
Icon Services defines constants for commonly-used system icons. You can pass one of these constants in the iconType parameter if you specify kSystemIconCreator in the creator parameter. See Folder Icon Constants for a list of these constants.

Calling the GetIconRef function increments the reference count of the IconRef .

Note

Remember to call the function ReleaseIconRef when you are done with an IconRef .


© 1999 Apple Computer, Inc. – (Last Updated 03 Dec 99)